package com.jinzhi.jzweb.domain.enumConstants;

public enum UnitTypeEnum {
    UNIT_TYPE("0","职业学校"),UNIT_TYPE1("1","科研机构"),UNIT_TYPE2("2","行业机构组织"),UNIT_TYPE3("3","上下游企业"),
    UNIT_TYPE4("4","其他单位");

    UnitTypeEnum(String code, String descp){
        this.code = code;
        this.descp = descp;
    }

    private final String code;
    private final String descp;

    public String getCode() {
        return code;
    }

    public String getDescp() {
        return descp;
    }


    public static String getDescpByCode(String code){
        for (UnitTypeEnum value: UnitTypeEnum.values()) {
            if(value.getCode().equals(code)){
                return value.getDescp();
            }
        }
        return null;
    }

    public static UnitTypeEnum getEnumByCode(String code){
        for (UnitTypeEnum value: UnitTypeEnum.values()) {
            if(value.getCode().equals(code)){
                return value;
            }
        }
        return null;
    }
}
